package com.ruoyi.iptv.nva.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iptv.nva.mapper.IptvNvaMapper;
import com.ruoyi.iptv.nva.domain.IptvNva;
import com.ruoyi.iptv.nva.service.IIptvNvaService;
import com.ruoyi.common.core.text.Convert;

/**
 * 分类导航Service业务层处理
 * 
 * @author 玉念聿辉
 * @date 2021-10-20
 */
@Service
public class IptvNvaServiceImpl implements IIptvNvaService 
{
    @Autowired
    private IptvNvaMapper iptvNvaMapper;

    /**
     * 查询分类导航
     * 
     * @param nvaId 分类导航主键
     * @return 分类导航
     */
    @Override
    public IptvNva selectIptvNvaByNvaId(Long nvaId)
    {
        return iptvNvaMapper.selectIptvNvaByNvaId(nvaId);
    }

    /**
     * 查询分类导航列表
     * 
     * @param iptvNva 分类导航
     * @return 分类导航
     */
    @Override
    public List<IptvNva> selectIptvNvaList(IptvNva iptvNva)
    {
        return iptvNvaMapper.selectIptvNvaList(iptvNva);
    }

    /**
     * 新增分类导航
     * 
     * @param iptvNva 分类导航
     * @return 结果
     */
    @Override
    public int insertIptvNva(IptvNva iptvNva)
    {
        iptvNva.setCreateTime(DateUtils.getNowDate());
        return iptvNvaMapper.insertIptvNva(iptvNva);
    }

    /**
     * 修改分类导航
     * 
     * @param iptvNva 分类导航
     * @return 结果
     */
    @Override
    public int updateIptvNva(IptvNva iptvNva)
    {
        iptvNva.setUpdateTime(DateUtils.getNowDate());
        return iptvNvaMapper.updateIptvNva(iptvNva);
    }

    /**
     * 批量删除分类导航
     * 
     * @param nvaIds 需要删除的分类导航主键
     * @return 结果
     */
    @Override
    public int deleteIptvNvaByNvaIds(String nvaIds)
    {
        return iptvNvaMapper.deleteIptvNvaByNvaIds(Convert.toStrArray(nvaIds));
    }

    /**
     * 删除分类导航信息
     * 
     * @param nvaId 分类导航主键
     * @return 结果
     */
    @Override
    public int deleteIptvNvaByNvaId(Long nvaId)
    {
        return iptvNvaMapper.deleteIptvNvaByNvaId(nvaId);
    }
}
